/*****************************************************************************
 *
 * Copyright (c), 2004-2020,ShangHai Neotune Information Technology Co., Ltd.
 *
 * Module Name : auxmth.h
 *
 * Author :    sean
 *
 * Date :    2004-02-05
 *
 * Version :    1.00
 *
 * Description :    
 *
 * Other :    
 *
 * Data Structure List: <Main Data Structure>
 *
 * Modification History
 * ---------------------------------------------------------------------------
 *  1: Data :      2004-02-05
 *    Author :     sean
 *    Version :    V100R001M00
 *    Modification : creation
 *
*****************************************************************************/

/* Defs for all of the method routines written in auxi */

#ifndef auxmth_inc
#define auxmth_inc

#ifdef __cplusplus
extern"C" {
#endif

#if (!defined(asn1conf_inc))
#include <asn1conf.h>
#endif

#if (!defined(buildpkt_inc))
#include "buildpkt.h"
#endif

/* null test functions */
extern int null_test_proc __((int         form,
                              OIDC_T      lastmatch,
                              int         tcount,
                              OIDC_T     *tlist,
                              char       *cookie,
                              SNMP_PKT_T *pktp,
                              int         indx));

extern void null_test_async __((OIDC_T      lastmatch,
                                int         tcount,
                                OIDC_T     *tlist,
                                SNMP_PKT_T *pktp,
                                VB_T       *vbp));


/* generic test function (for non-settable scalars) */
extern int it_exists __((int             form,
                         OIDC_T          lastmatch,
                         int             tcount,
                         OIDC_T         *tlist,
                         char           *cookie,
                         SNMP_PKT_T     *pktp,
                         int             vb_index));

extern void it_exists_async __((OIDC_T     lastmatch,
                               int         tcount,
                               OIDC_T     *tlist,
                               SNMP_PKT_T *pktp,
                               VB_T       *vbp));

/* Test function for test and increment type variables */
extern void test_TestAndIncr_async __((OIDC_T      lastmatch,
                                       int         tcount,
                                       OIDC_T     *tlist,
                                       SNMP_PKT_T *pktp,
                                       VB_T       *vbp));

#if (ENVOY_USE_V2_TYPES)
/* Test and cleanup functions for UInteger64 */
extern void ui64_async_test __((OIDC_T      lastmatch,
                                int         tcount,
                                OIDC_T     *tlist,
                                SNMP_PKT_T *pktp,
                                VB_T       *vbp));

extern void ui64_async_cleanup __((PTR_T value));

#endif

/* various get functions */

extern INT_32_T null_get_proc __((OIDC_T         lastmatch,
                                  int            tcount,
                                  OIDC_T        *tlist,
                                  char          *cookie,
                                  SNMP_PKT_T    *pktp));

extern void null_get_async __((OIDC_T      lastmatch,
                               int         tcount,
                               OIDC_T     *tlist,
                               SNMP_PKT_T *pktp,
                               VB_T       *vbp));


extern INT_32_T get_int __((OIDC_T       lastmatch,
                            int          tcount,
                            OIDC_T      *tlist,
                            char        *cookie,
                            SNMP_PKT_T  *pktp));


extern unsigned char *get_ip_address __((OIDC_T          lastmatch,
                                         int             tcount,
                                         OIDC_T         *tlist,
                                         char           *cookie,
                                         SNMP_PKT_T     *pktp,
                                         UINT_32_T      *addr));

extern OBJ_ID_T *get_object_identifier __((OIDC_T        lastmatch,
                                           int           tcount,
                                           OIDC_T       *tlist,
                                           char         *cookie,
                                           SNMP_PKT_T   *pktp,
                                           int          *dynamic));

extern unsigned char *get_string __((OIDC_T      lastmatch,
                                     int         tcount,
                                     OIDC_T     *tlist,
                                     char       *cookie,
                                     int        *lengthp,
                                     SNMP_PKT_T *pktp,
                                     int        *dynamic));

extern UINT_32_T get_uint __((OIDC_T      lastmatch,
                              int         tcount,
                              OIDC_T     *tlist,
                              char       *cookie,
                              SNMP_PKT_T *pktp));

extern UINT_32_T get_ulong __((OIDC_T      lastmatch,
                               int         tcount,
                               OIDC_T     *tlist,
                               char       *cookie,
                               SNMP_PKT_T *pktp));

/* We only include these two functions if v2 types are in use */
#if (ENVOY_USE_V2_TYPES)
extern UINT_64_T *get_ui64 __((OIDC_T      lastmatch,
                               int         tcount,
                               OIDC_T     *tlist,
                               char       *cookie,
                               SNMP_PKT_T *pktp,
                               int        *dynamic));
#endif


extern void get_int_async __((OIDC_T      lastmatch,
                              int         tcount,
                              OIDC_T     *tlist,
                              SNMP_PKT_T *pktp,
                              VB_T       *vbp));

extern void get_ip_address_async __((OIDC_T      lastmatch,
                                     int         tcount,
                                     OIDC_T     *tlist,
                                     SNMP_PKT_T *pktp,
                                     VB_T       *vbp));

extern void get_object_identifier_async __((OIDC_T       lastmatch,
                                            int          tcount,
                                            OIDC_T      *tlist,
                                            SNMP_PKT_T  *pktp,
                                            VB_T        *vbp));

extern void get_string_async __((OIDC_T      lastmatch,
                                 int         tcount,
                                 OIDC_T     *tlist,
                                 SNMP_PKT_T *pktp,
                                 VB_T       *vbp));

extern void get_uint_async __((OIDC_T      lastmatch,
                               int         tcount,
                               OIDC_T     *tlist,
                               SNMP_PKT_T *pktp,
                               VB_T       *vbp));

extern void get_ulong_async __((OIDC_T      lastmatch,
                                int         tcount,
                                OIDC_T     *tlist,
                                SNMP_PKT_T *pktp,
                                VB_T       *vbp));

extern void get_TestAndIncr_async __((OIDC_T      lastmatch,
                                      int         tcount,
                                      OIDC_T     *tlist,
                                      SNMP_PKT_T *pktp,
                                      VB_T       *vbp));

/* We only include these two functions if v2 types are in use */
#if (ENVOY_USE_V2_TYPES)
extern void get_ui64_async __((OIDC_T      lastmatch,
                               int         tcount,
                               OIDC_T     *tlist,
                               SNMP_PKT_T *pktp,
                               VB_T       *vbp));
#endif

/* null next functions */
extern int null_next_proc __((OIDC_T      lastmatch,
                              int         tcount,
                              OIDC_T     *tlist,
                              OIDC_T     *rlist,
                              char       *cookie,
                              SNMP_PKT_T *pktp));

extern void null_next_async __((OIDC_T      lastmatch,
                                int         tcount,
                                OIDC_T     *tlist,
                                SNMP_PKT_T *pktp,
                                VB_T       *vbp));

/* various undo procedures */
extern void undo_int_async __((OIDC_T      lastmatch,
                               int         tcount,
                               OIDC_T     *tlist,
                               SNMP_PKT_T *pktp,
                               VB_T       *vbp));

extern void undo_uint_async __((OIDC_T      lastmatch,
                                int         tcount,
                                OIDC_T     *tlist,
                                SNMP_PKT_T *pktp,
                                VB_T       *vbp));

extern void undo_TestAndIncr_async __((OIDC_T      lastmatch,
                                       int         tcount,
                                       OIDC_T     *tlist,
                                       SNMP_PKT_T *pktp,
                                       VB_T       *vbp));

#if (ENVOY_USE_V2_TYPES)
extern void ui64_async_undo __((OIDC_T      lastmatch,
                                int         tcount,
                                OIDC_T     *tlist,
                                SNMP_PKT_T *pktp,
                                VB_T       *vbp));
#endif

/* various set procedures */
extern void null_set_proc __((OIDC_T      lastmatch,
                              int         tcount,
                              OIDC_T     *tlist,
                              char       *cookie,
                              INT_32_T    value,
                              SNMP_PKT_T *pktp,
                              int         vb_index));

extern void null_set_async __((OIDC_T      lastmatch,
                               int         tcount,
                               OIDC_T     *tlist,
                               SNMP_PKT_T *pktp,
                               VB_T       *vbp));


extern void set_int __((OIDC_T           lastmatch,
                        int              tcount,
                        OIDC_T          *tlist,
                        char            *cookie,
                        INT_32_T         value,
                        SNMP_PKT_T      *pktp,
                        int              vb_index));

extern void set_uint __((OIDC_T          lastmatch,
                         int             tcount,
                         OIDC_T         *tlist,
                         char           *cookie,
                         UINT_32_T       value,
                         SNMP_PKT_T     *pktp,
                         int             vb_index));

/* We only include this function if v2 types are in use */
#if (ENVOY_USE_V2_TYPES)
extern void set_ui64 __((OIDC_T          lastmatch,
                         int             tcount,
                         OIDC_T         *tlist,
                         char           *cookie,
                         UINT_32_T       high,
                         UINT_32_T       low,
                         SNMP_PKT_T     *pktp,
                         int             vb_index));
#endif

extern void set_int_async __((OIDC_T      lastmatch,
                              int         tcount,
                              OIDC_T     *tlist,
                              SNMP_PKT_T *pktp,
                              VB_T       *vbp));


extern void set_uint_async __((OIDC_T      lastmatch,
                               int         tcount,
                               OIDC_T     *tlist,
                               SNMP_PKT_T *pktp,
                               VB_T       *vbp));


extern void set_TestAndIncr_async __((OIDC_T      lastmatch,
                                      int         tcount,
                                      OIDC_T     *tlist,
                                      SNMP_PKT_T *pktp,
                                      VB_T       *vbp));

/* We only include this function if v2 types are in use */
#if (ENVOY_USE_V2_TYPES)
extern void ui64_async_set __((OIDC_T      lastmatch,
                               int         tcount,
                               OIDC_T     *tlist,
                               SNMP_PKT_T *pktp,
                               VB_T       *vbp));
#endif

#ifdef __cplusplus
}
#endif

#endif
